home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group94a.txt / 000083_icon-group-sender _Tue Apr 19 06:40:37 1994.msg < prev    next >
Internet Message Format  |  1994-08-19  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 19 Apr 1994 09:23:09 MST
  2. Via: uk.ac.edinburgh.festival; Tue, 19 Apr 1994 14:03:19 +0100
  3. Date: 19 Apr 94 14:03:10 BST
  4. From: R J Hare <rjhare@festival.ed.ac.uk>
  5. Subject: random numbers
  6. To: icon-group@cs.arizona.edu
  7. Organisation: Edinburgh University Computing Service
  8. Message-Id: <9404191403.aa04644@uk.ac.ed.festival>
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12.  
  13. I have a program in which I have an integer which marks the upper end of a
  14. range from which I wish to randomly select a value. I am using:
  15.  
  16. i:=?range
  17.  
  18. so, if I have previously set range to (say) 13, I should get i in the range
  19. 1..13. In fact, I am getting i equals 1 or 3, ie: ? is apparently treating
  20. range as a 2 character string and returning randomly the value of the 1st or
  21. 2nd character in the string. Is this behaviour correct?
  22.  
  23. If I do something like:
  24.  
  25. i:=?integer(range)
  26.  
  27. all is well.
  28.  
  29. I am a little puzzled by this behaviour and would be grateful if someone
  30. could explain it...
  31.  
  32. Thanks.
  33.  
  34. RogerHare
  35.